close

abstract fun close()

Closes this JavaScript object.

This method makes the underlying v8 object eligible for garbage collection, but does not guarantee that it will be destroyed. That is, if the object is still used by the JavaScript code on the web page (there are references to this object), you can obtain it again through the JavaScript API.

Use this method to make unused JavaScript objects garbage collectable. This is especially useful when you transfer a large number of objects through the JavaScript-Java bridge, or when those are objects that can hold a large amount of memory: JsArrayBuffer, JsArray, JsSet, JsMap, etc.

All JavaScript objects are closed automatically when you perform a navigation, reload the web page, or close the browser.

Since

7.32